<#include "/generation-templates/directive/field-type.ftl"/>
<#include "/generation-templates/directive/field-comment.ftl"/>
package ${package};

import ${basePackage}.entity.${table.getCamelName()};
<#list table.getFields() as field>
<#if field.getRules().match("enum")>
import ${field.getType().getName()};
</#if>
</#list>

/**
 * ${table.getComment()}仓库接口类
 * @author venus
 */
public interface ${table.getCamelName()}Repository extends FrameworkRepository<${table.getCamelName()}, ${primary.getType().getSimpleName()}> {

    <#list table.getFields() as field>
    <#if field.getRules().match("unique")>
    /**
     * 判断${field.getComment()}是否存在
     * @param ${field.getLowerCamelName()} ${field.getComment()}
     * @return 存在的${table.getComment()}
     */
     ${table.getCamelName()} getBy${field.getCamelName()}(String ${field.getLowerCamelName()});

    </#if>
    </#list>
    <#if table.getRules().match("multiUnique")>
    /**
     * 判断<#list table.getRules().getRule("multiUnique").getParam("fields")?split("-") as val>${val}<#sep>, </#list>确定的记录是否存在
     <#list table.getRules().getRule("multiUnique").getParam("fields")?split("-") as val>
     * @param ${val} <@fieldComment tableInfo = table name = val ; comment>${comment}</@fieldComment>
     </#list>
     * @return 存在的${table.getComment()}
     */
     ${table.getCamelName()} getBy<#list table.getRules().getRule("multiUnique").getParam("fields")?split("-") as val>${val?cap_first}<#sep>And</#list>(<#list table.getRules().getRule("multiUnique").getParam("fields")?split("-") as val><@fieldType tableInfo = table name = val ; type>${type}</@fieldType> ${val}<#sep>, </#list>);

    </#if>
}